#pragma once

#include "Primitive.h"

class Sphere: public Primitive
{
private:
	float radius;
	int slices, stacks;
	GLUquadric *glQ;
public:
	Sphere() {};
	void render()
	{
		if(getTex() != NULL)
		{
			glEnable(GL_TEXTURE_2D);
				glBindTexture(GL_TEXTURE_2D, getTex()->getTexID());
				gluQuadricTexture(glQ,true);
				gluSphere(glQ, radius, slices, stacks);
			glDisable(GL_TEXTURE_2D);
		}
		else
		{
			gluSphere(glQ, radius, slices, stacks);
		}
	}
	void setQuadric(GLUquadric *g)
	{
		glQ = g;
	}
	void setValues(float r, int slice, int stack)
	{
		radius = r;
		slices = slice;
		stacks = stack;
	}
};